<?php
	class nguoidungbs
	{
		// Các trường
		public $MaNguoiDung = ""; // auto_increment
		public $MatKhau = "";
		public $Ho = "";
		public $Ten = "";
		public $DiaChi = "";
		public $DienThoai = "";
		public $GioiTinh = 0;
		public $NgaySinh = "";
		public $Email = "";
		public $NgayThamGia = "";
		public $MaQuyen = 0;
		public $MaPhongBan = "";
		public $MaChucVu = 0;
		public $MaPhongGD = "";
		public $Khoa = 0;
		public $TimPhongBan = "";
		public $MatKhauMoi ="";
		// Các phương thức
		public function Them()
		{
			$db = new nguoidungdb();
			return $db->Them(
							 $this->MaNguoiDung, 
							 $this->MatKhau,
						     $this->Ho,
							 $this->Ten,
						     $this->DiaChi,
						     $this->DienThoai,
						     $this->GioiTinh,
						     $this->NgaySinh, 
							 $this->Email,
							 $this->NgayThamGia, 
							 $this->MaQuyen,	
							 $this->MaPhongBan,
							 $this->MaChucVu,
							 $this->MaPhongGD,
							 $this->Khoa);
		}
		
		public function CapNhat()
		{
			$db = new nguoidungdb();
			return $db->CapNhat($this->MaNguoiDung,
								$this->MatKhau,							
						     	$this->Ho,
								$this->Ten,
						     	$this->DiaChi,
						     	$this->DienThoai,
						     	$this->GioiTinh,
						     	$this->NgaySinh, 
							 	$this->Email,
							 	$this->MaQuyen,	
							 	$this->MaPhongBan,
							 	$this->MaChucVu,
							 	$this->MaPhongGD);
		}
		
		public function LayDanhSach()
		{
			$db = new nguoidungdb();
			return $db->LayDanhSach($this->MaNguoiDung,
									$this->MatKhau, 
									$this->Ho,
							 	 	$this->Ten,
									$this->DienThoai,
							 	 	$this->GioiTinh,
									$this->NgaySinh,
									$this->Email,
							 		$this->NgayThamGia,
							 		$this->MaQuyen,	
							 		$this->MaPhongBan,
							 		$this->MaChucVu,
							 		$this->MaPhongGD,
									$this->Khoa,
									$this->TimPhongBan);
		}
		
		public function CapNhatKhoa()
		{
			$db = new nguoidungdb();
			return $db->CapNhatKhoa($this->MaNguoiDung,
									$this->Khoa);
		}
		
		public function CapNhatMatKhau()
		{
			$db = new nguoidungdb();
			return $db->CapNhatMatKhau($this->MaNguoiDung,
									   $this->MatKhauMoi);
		}
		
		public function Xoa()
		{
			$db = new nguoidungdb();
			return $db->Xoa($this->MaNguoiDung);
		}	
		
		public function TonTaiTrongKeKhaiGiaoDich()
		{
			$db = new nguoidungdb();
			return $db->TonTaiTrongKeKhaiGiaoDich($this->MaNguoiDung);
		}
		
		public function XoaTatCa()
		{
			$db = new nguoidungdb();
			return $db->XoaTatCa();
		}
	}
?>